
<!-- <{foreach from=$data item=v}>
<img src="<{$v.icon}>" width="50px" alt="用户头像"/>
<{$v.name}>
<{if $v.type == 1}>
已读 ------<{$v.message}>
<{else}>
    未读 -----<{$v.message}>
<{/if}>
<{$v.created}>
    <a href="/guider/show_notice/<{$v.id}>">查看</a>
    <a href="/guider/remove_notice/<{$v.id}>">删除</a>
<{/foreach}> -->

<h2 class="title">我的提醒</h2>
<{if $data|@count == 0}>
<div class="box-none">
    <img src="/resource/www/imgs/box_none_icon.png" class="img">
    <p class="text">抱歉，你还没有提醒！</p>

</div>
<{else}>
<ul class="nt-list">
    <{foreach from=$data item=v}>
    <li class="li fix"  >
        <div class="left">
            <img src="<{$v.icon}>" class="img">
        </div>
        <div class="center">
            <{if $v.type == 1}>
             <p class="xiaoxi" style="color: rgb(137, 137, 137);">
                 <{$v.name}>：
                <{$v.message}>
             </p>
            <{else}>
            <p class="xiaoxi">
            <{$v.name}>：
            <{$v.message}>
                </p>
            <{/if}>

        </div>
        <div class="right">
            <p class="date"><{$v.created}></p>
            <p class="caozuo">
                <!-- <a href="/guider/show_notice/<{$v.id}>" class="view">查看</a>
                <a href="/guider/remove_notice/<{$v.id}>" class="del">删除</a> -->

                <a href="javascript:;" onclick="view_notice(this);" data="<{$v.id}>" class="view">查看</a>
                <{if $v.undel != 1}>
                <a href="javascript:;" onclick="return notice_del_confirm(this);" data="<{$v.id}>" class="del">删除</a>
                <{/if}>
            </p>
        </div>
    </li>
    <{/foreach}>
</ul>
<{$pagination}>
<{/if}>
<script>
    $('.notice').addClass("active");
</script>

<script>

function view_notice(item) {
    if (!$(item).parents('li').find('p').hasClass('auto')) {
        $(item).parents('li').find('p').removeClass('xiaoxi').addClass('auto');
        $(item).parents('li').find('p').css('color', '#898989');
    } else {
        $(item).parents('li').find('p').removeClass('auto').addClass('xiaoxi');
    }

    var id = $(item).attr('data');
    $.get('/guider/show_notice/'+id,function(data){
        var obj = JSON.parse(data);
        if(obj.status == 0){
            var num = $("#notice_num").html();
            var i = num-1;
            $("#notice_num").html(i);
        }
    });

}

function notice_del_confirm(item){
    var id = $(item).attr('data');
    layer.confirm('确认删除这条信息吗', {
            btn: ['是的','取消'], //按钮
            title: false,
            area: ['200px', '150px']
        },function(){
            location.href='/guider/remove_notice/'+id;
        },function(){
            return true;
    });

}

</script>
